#include "openmove_Prefix.h"
#include "SceneBase.h"
#include "OgreEngine.h"
#include "ExampleFrameListener.h"
#include "SkeletalAnimationFrameListener.h"
#include "OgreExternalTextureSourceManager.h"
#include "OgreExternalTextureSource.h"
#include "ScenePluie.h"
#include "SimpleFrameListener.h"

CScenePluie :: CScenePluie(COgreEngine &Creator, const String & Name, const int pos) : CSceneBase(Creator, Name, pos), m_pPluie(NULL), m_pPluieTop(NULL)
{
}

CScenePluie :: ~CScenePluie(void)
{
}

void CScenePluie :: Create(TCreatorEntities const &CreatorEntities, TCreatorNodes const &CreatorNodes, TCreatorLights const &CreatorLights, ENetConfig IsClient, Vector3 &CameraStartPos)
{
	CSceneBase::Create(CreatorEntities, CreatorNodes, CreatorLights, IsClient, CameraStartPos);

	m_pPluie = m_OgreEngine.m_pCurrentSceneManager->createParticleSystem("Pluie1", "pluie1");
	SceneNode *pNode = m_pSceneNode->createChildSceneNode("Pluie1", Vector3(-200.0f, 300.0f, -50.0f));
	pNode->attachObject(m_pPluie);

	m_pPluieTop = m_OgreEngine.m_pCurrentSceneManager->createParticleSystem("Pluie1Top", "pluie1top");
	pNode = m_pSceneNode->createChildSceneNode("Pluie1Top", Vector3(-200.0f, 350.0f, -50.0f));
	pNode->attachObject(m_pPluieTop);

	//m_OgreEngine.m_pCurrentSceneManager->setSkyBox(true, "SkyBox/Mountains");
}


bool CScenePluie :: frameStarted(const FrameEvent& evt)
{
	CSceneBase::frameStarted(evt);
	return (true);
}

void CScenePluie :: Attach(void)
{
	CSceneBase::Attach();
	//m_pCurrentCamera->setPosition(-180.8f, 87.7f, 452.3f);
	//Quaternion Quat(Radian(Degree(0.0f)), Vector3(0, 1, 0));
	//m_pCurrentCamera->setOrientation(Quat);
	//m_pCurrentCamera->setDirection(0, 0, -1);
	m_OgreEngine.m_pViewPort->setBackgroundColour(ColourValue(1.0f, 0.38f, 0.89f, 1.0f));
}